import java.util.Scanner;

public class Bowling
{
	public static void main(String args[])
	{
		Scanner kb = new Scanner(System.in);
		BowlingGame bg = new BowlingGame();
		p("Bowling game started.");
		int bowlNumber = 0;
		while (bg.getFrames().get(bg.getFrames().size() - 1).getAttempts() > 0)
		{
			bowlNumber++;
			pr("Please bowl: ");
			int pins = kb.nextInt();
			bg.bowl(pins);
			pr(pins + " PINS! ");
			pr("SCORE " + bg.getScore() + " on FRAME " + (bg.getIndex() + 1) + " and BOWL " + bowlNumber);
			if (bg.getCurrent().bowls.size() >= 2 && bg.getCurrent().isStrike())
			{
				pr("     STRIKE!");
			}
			else if (bg.getCurrent().bowls.size() >= 2 && bg.getCurrent().isSpare())
			{
				pr("     SPARE!");
			}
			p();
		}
	}
	public static void p(Object o)
	{
		System.out.println(o);
	}
	public static void p()
	{
		System.out.println();
	}
	public static void pr(Object o)
	{
		System.out.print(o);
	}
}
